3.16.34 \(\int \frac {(b+2 c x) (d+e x)^2}{(a+b x+c x^2)^2} \, dx\) [1534]

Optimal. Leaf size=87 \[ -\frac {(d+e x)^2}{a+b x+c x^2}-\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c} \]

[Out]

-(e*x+d)^2/(c*x^2+b*x+a)+e^2*ln(c*x^2+b*x+a)/c-2*e*(-b*e+2*c*d)*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/c/(-4*a*
c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {782, 648, 632, 212, 642} \begin {gather*} -\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((b + 2*c*x)*(d + e*x)^2)/(a + b*x + c*x^2)^2,x]

[Out]

-((d + e*x)^2/(a + b*x + c*x^2)) - (2*e*(2*c*d - b*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c*Sqrt[b^2 - 4*
a*c]) + (e^2*Log[a + b*x + c*x^2])/c

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 782

Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Sim
p[g*(d + e*x)^m*((a + b*x + c*x^2)^(p + 1)/(2*c*(p + 1))), x] - Dist[e*g*(m/(2*c*(p + 1))), Int[(d + e*x)^(m -
 1)*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[2*c*f - b*g, 0] && LtQ[p, -1]
&& GtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(b+2 c x) (d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx &=-\frac {(d+e x)^2}{a+b x+c x^2}+(2 e) \int \frac {d+e x}{a+b x+c x^2} \, dx\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{c}+\frac {(e (2 c d-b e)) \int \frac {1}{a+b x+c x^2} \, dx}{c}\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c}-\frac {(2 e (2 c d-b e)) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c}\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}-\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 98, normalized size = 1.13 \begin {gather*} \frac {\frac {e^2 (a+b x)-c d (d+2 e x)}{a+x (b+c x)}-\frac {2 e (-2 c d+b e) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+e^2 \log (a+x (b+c x))}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((b + 2*c*x)*(d + e*x)^2)/(a + b*x + c*x^2)^2,x]

[Out]

((e^2*(a + b*x) - c*d*(d + 2*e*x))/(a + x*(b + c*x)) - (2*e*(-2*c*d + b*e)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*
c]])/Sqrt[-b^2 + 4*a*c] + e^2*Log[a + x*(b + c*x)])/c

________________________________________________________________________________________

Maple [A]
time = 0.96, size = 110, normalized size = 1.26

method result size
default \(\frac {\frac {e \left (b e -2 c d \right ) x}{c}+\frac {e^{2} a -c \,d^{2}}{c}}{c \,x^{2}+b x +a}+2 e \left (\frac {e \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (d -\frac {b e}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}\right )\) \(110\)
risch \(\frac {\frac {e \left (b e -2 c d \right ) x}{c}+\frac {e^{2} a -c \,d^{2}}{c}}{c \,x^{2}+b x +a}+\frac {4 e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) a}{4 a c -b^{2}}-\frac {e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) b^{2}}{c \left (4 a c -b^{2}\right )}+\frac {e \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}}{c \left (4 a c -b^{2}\right )}+\frac {4 e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) a}{4 a c -b^{2}}-\frac {e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) b^{2}}{c \left (4 a c -b^{2}\right )}-\frac {e \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}}{c \left (4 a c -b^{2}\right )}\) \(700\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2*c*x+b)*(e*x+d)^2/(c*x^2+b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

(e*(b*e-2*c*d)/c*x+(a*e^2-c*d^2)/c)/(c*x^2+b*x+a)+2*e*(1/2*e*ln(c*x^2+b*x+a)/c+2*(d-1/2*b*e/c)/(4*a*c-b^2)^(1/
2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)^2/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 254 vs. \(2 (85) = 170\).
time = 2.25, size = 528, normalized size = 6.07 \begin {gather*} \left [-\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x e + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{2} c - 4 \, a c^{2}\right )} x^{2} + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2} \log \left (c x^{2} + b x + a\right ) - \sqrt {b^{2} - 4 \, a c} {\left ({\left (b c x^{2} + b^{2} x + a b\right )} e^{2} - 2 \, {\left (c^{2} d x^{2} + b c d x + a c d\right )} e\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2}}{a b^{2} c - 4 \, a^{2} c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} x^{2} + {\left (b^{3} c - 4 \, a b c^{2}\right )} x}, -\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x e + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{2} c - 4 \, a c^{2}\right )} x^{2} + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2} \log \left (c x^{2} + b x + a\right ) - 2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (b c x^{2} + b^{2} x + a b\right )} e^{2} - 2 \, {\left (c^{2} d x^{2} + b c d x + a c d\right )} e\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2}}{a b^{2} c - 4 \, a^{2} c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} x^{2} + {\left (b^{3} c - 4 \, a b c^{2}\right )} x}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)^2/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

[-(2*(b^2*c - 4*a*c^2)*d*x*e + (b^2*c - 4*a*c^2)*d^2 - (a*b^2 - 4*a^2*c + (b^2*c - 4*a*c^2)*x^2 + (b^3 - 4*a*b
*c)*x)*e^2*log(c*x^2 + b*x + a) - sqrt(b^2 - 4*a*c)*((b*c*x^2 + b^2*x + a*b)*e^2 - 2*(c^2*d*x^2 + b*c*d*x + a*
c*d)*e)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) - (a*b^2 -
4*a^2*c + (b^3 - 4*a*b*c)*x)*e^2)/(a*b^2*c - 4*a^2*c^2 + (b^2*c^2 - 4*a*c^3)*x^2 + (b^3*c - 4*a*b*c^2)*x), -(2
*(b^2*c - 4*a*c^2)*d*x*e + (b^2*c - 4*a*c^2)*d^2 - (a*b^2 - 4*a^2*c + (b^2*c - 4*a*c^2)*x^2 + (b^3 - 4*a*b*c)*
x)*e^2*log(c*x^2 + b*x + a) - 2*sqrt(-b^2 + 4*a*c)*((b*c*x^2 + b^2*x + a*b)*e^2 - 2*(c^2*d*x^2 + b*c*d*x + a*c
*d)*e)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - (a*b^2 - 4*a^2*c + (b^3 - 4*a*b*c)*x)*e^2)/(a*b
^2*c - 4*a^2*c^2 + (b^2*c^2 - 4*a*c^3)*x^2 + (b^3*c - 4*a*b*c^2)*x)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 340 vs. \(2 (78) = 156\).
time = 2.10, size = 340, normalized size = 3.91 \begin {gather*} \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 4 a c \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) + 4 a e^{2} + b^{2} \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) - 2 b d e}{2 b e^{2} - 4 c d e} \right )} + \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 4 a c \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) + 4 a e^{2} + b^{2} \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) - 2 b d e}{2 b e^{2} - 4 c d e} \right )} + \frac {a e^{2} - c d^{2} + x \left (b e^{2} - 2 c d e\right )}{a c + b c x + c^{2} x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)**2/(c*x**2+b*x+a)**2,x)

[Out]

(e**2/c - e*sqrt(-4*a*c + b**2)*(b*e - 2*c*d)/(c*(4*a*c - b**2)))*log(x + (-4*a*c*(e**2/c - e*sqrt(-4*a*c + b*
*2)*(b*e - 2*c*d)/(c*(4*a*c - b**2))) + 4*a*e**2 + b**2*(e**2/c - e*sqrt(-4*a*c + b**2)*(b*e - 2*c*d)/(c*(4*a*
c - b**2))) - 2*b*d*e)/(2*b*e**2 - 4*c*d*e)) + (e**2/c + e*sqrt(-4*a*c + b**2)*(b*e - 2*c*d)/(c*(4*a*c - b**2)
))*log(x + (-4*a*c*(e**2/c + e*sqrt(-4*a*c + b**2)*(b*e - 2*c*d)/(c*(4*a*c - b**2))) + 4*a*e**2 + b**2*(e**2/c
 + e*sqrt(-4*a*c + b**2)*(b*e - 2*c*d)/(c*(4*a*c - b**2))) - 2*b*d*e)/(2*b*e**2 - 4*c*d*e)) + (a*e**2 - c*d**2
 + x*(b*e**2 - 2*c*d*e))/(a*c + b*c*x + c**2*x**2)

________________________________________________________________________________________

Giac [A]
time = 1.86, size = 114, normalized size = 1.31 \begin {gather*} \frac {e^{2} \log \left (c x^{2} + b x + a\right )}{c} + \frac {2 \, {\left (2 \, c d e - b e^{2}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c} - \frac {\frac {{\left (2 \, c d e - b e^{2}\right )} x}{c} + \frac {c d^{2} - a e^{2}}{c}}{c x^{2} + b x + a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2*c*x+b)*(e*x+d)^2/(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

e^2*log(c*x^2 + b*x + a)/c + 2*(2*c*d*e - b*e^2)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c)
 - ((2*c*d*e - b*e^2)*x/c + (c*d^2 - a*e^2)/c)/(c*x^2 + b*x + a)

________________________________________________________________________________________

Mupad [B]
time = 0.18, size = 248, normalized size = 2.85 \begin {gather*} \frac {a\,e^2}{c^2\,x^2+b\,c\,x+a\,c}-\frac {d^2}{c\,x^2+b\,x+a}+\frac {b\,e^2\,x}{c^2\,x^2+b\,c\,x+a\,c}-\frac {2\,d\,e\,x}{c\,x^2+b\,x+a}-\frac {b^2\,e^2\,\ln \left (c\,x^2+b\,x+a\right )}{4\,a\,c^2-b^2\,c}+\frac {4\,d\,e\,\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )}{\sqrt {4\,a\,c-b^2}}-\frac {2\,b\,e^2\,\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )}{c\,\sqrt {4\,a\,c-b^2}}+\frac {4\,a\,c\,e^2\,\ln \left (c\,x^2+b\,x+a\right )}{4\,a\,c^2-b^2\,c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((b + 2*c*x)*(d + e*x)^2)/(a + b*x + c*x^2)^2,x)

[Out]

(a*e^2)/(a*c + c^2*x^2 + b*c*x) - d^2/(a + b*x + c*x^2) + (b*e^2*x)/(a*c + c^2*x^2 + b*c*x) - (2*d*e*x)/(a + b
*x + c*x^2) - (b^2*e^2*log(a + b*x + c*x^2))/(4*a*c^2 - b^2*c) + (4*d*e*atan(b/(4*a*c - b^2)^(1/2) + (2*c*x)/(
4*a*c - b^2)^(1/2)))/(4*a*c - b^2)^(1/2) - (2*b*e^2*atan(b/(4*a*c - b^2)^(1/2) + (2*c*x)/(4*a*c - b^2)^(1/2)))
/(c*(4*a*c - b^2)^(1/2)) + (4*a*c*e^2*log(a + b*x + c*x^2))/(4*a*c^2 - b^2*c)

________________________________________________________________________________________